package yue.shen.android.demo.view.banner

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import yue.shen.android.demo.R
import yue.shen.android.demo.databinding.ActivityBannerTestBinding

class TestBannerActivity : AppCompatActivity() {

    private lateinit var viewBinding: ActivityBannerTestBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewBinding = ActivityBannerTestBinding.inflate(layoutInflater)
        setContentView(viewBinding.root)
        initView()
    }


    private fun initView() {
        val viewList = ArrayList<Int>()
//        viewList.add(ImageView(this).apply {
//            setImageResource(R.mipmap.banner_test_1)
//            scaleType = ImageView.ScaleType.CENTER_CROP
//        })

        viewList.add(R.mipmap.banner_test_1)
        viewList.add(R.mipmap.banner_test_2)
        viewList.add(R.mipmap.banner_test_3)
        viewList.add(R.mipmap.banner_test_4)
        viewList.add(R.mipmap.banner_test_5)

        viewBinding.banner.setViewData(viewList)
    }

}